package com.swift.core.response;

import com.swift.core.constant.CommonEnum;

/**
 * @author Administrator
 * @description : 响应对象封装
 * @date 2022/06/18 18:19
 * @since open jdk 1.8
 */
public class ResponseResult<T> {
    private int status;
    private String message;
    private T data;

    public ResponseResult(CommonEnum commonEnum) {
        this.status = Integer.parseInt(commonEnum.getCode());
        this.message = commonEnum.getDescription();
    }

    public void setData(T data) {
        this.data = data;
    }

    public int getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

    public T getData() {
        return data;
    }

    public void setStatus(String status) {
        this.status = Integer.parseInt(status);
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
